package com.my.thread;

import jdk.management.resource.internal.inst.RandomAccessFileRMHooks;

import java.util.Random;

/**
 * @author Huangjin
 * @version 1.0
 * describe:
 * @date 2023/2/17 19:28
 */
public class Language {
    static final String[] questions = {
            "你叫什么名字？",
            "现在几点了？",
            "你早饭吃的什么？",
            "你中午吃的什么？",
            "你晚餐吃的什么？",
            "你的身高多少？",
            "你喜欢的明星是谁？",
            "你是机器人吗？",

    };
    //随机生成器
    static Random random = new Random();
    //当前问题
    static String question = null;
    //当前答案
    static String answer = null;
    /**
     * 随机获取一个问题
     */
    public static String getARandomQuestion(){
        int index = random.nextInt(questions.length);
        return questions[index];
    }
    //设置当前答案
    public static void setAnswer(String question){
        Language.answer = answer;
    }
    //设置当前问题
    public static void setQuestion(String question){
        Language.question = question;
    }
}
